package com.hnevc.androiduiclassone10;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import java.io.Serializable;

public class Activity extends AppCompatActivity {

    ImageView ivTupian;
    TextView tvMessage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_);

        ivTupian=findViewById(R.id.iv_tupian);

        Intent intent=getIntent();
        Serializable team=intent.getSerializableExtra("team");
        Team team1=(Team)team;

        switch (team1.getQiudui()){
            case "aodaliya":
                ivTupian.setImageResource(R.drawable.aidaliya);
                break;
            case "agenting":
                ivTupian.setImageResource(R.drawable.agenting);
                break;
            case "aiji":
                ivTupian.setImageResource(R.drawable.aiji);
                break;
            case "banama":
                ivTupian.setImageResource(R.drawable.banama);
                break;
            case "baxi":
                ivTupian.setImageResource(R.drawable.baxi);
                break;
        }
        tvMessage=findViewById(R.id.tvinfo);
        tvMessage.setText(team1.getMessage());
    }
}
